//
//  MeSetUpTableViewCell.m
//  QT
//
//  Created by 甘世清 on 2024/12/30.
//

#import "MeSetUpTableViewCell.h"

@implementation MeSetUpTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)SQ_Style:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    [self.contentView addSubview:self.leftImage];
    [self.contentView addSubview:self.messageLabel];
    
    UIImageView * rightImage = [[UIImageView alloc]init];
    rightImage.image = SQGetImage(@"youjiantou");
    [self.contentView addSubview:rightImage];
    [rightImage mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView);
            make.size.mas_equalTo(16);
            make.right.equalTo(self.contentView.mas_right).offset(-10);
    }];
    [self.contentView addSubview:self.leftImage];
    [self.contentView addSubview:self.messageLabel];
    [self.leftImage mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).offset(16);
            make.size.mas_equalTo(18);
            make.centerY.equalTo(self.contentView);
    }];
    [self.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).offset(44);
            make.centerY.equalTo(self.contentView);
    }];
}

-(void)SQ_setname:(NSString*)name{
    self.messageLabel.text = name;
    self.leftImage.image = SQGetImage(name);
}
- (UIImageView *)leftImage{
    if (!_leftImage) {
        _leftImage = [[UIImageView alloc]init];
        _leftImage.contentMode = UIViewContentModeScaleAspectFill;
    }
    return _leftImage;
}
- (UILabel *)messageLabel{
    if (!_messageLabel) {
        _messageLabel = [[UILabel alloc]init];
        _messageLabel.font = FONT_MEDIUM(14);
        _messageLabel.textColor = SQColor333333;
    }
    return _messageLabel;
}
@end
